package com.supermali.entity.npc.monistor.hurt;

import com.supermali.behavior.move.land.MonitorMove;
import com.supermali.creater.MapCreater;
import com.supermali.creater.img.ImgHelper;
import com.supermali.creater.img.ImgKey;
import com.supermali.creater.img.ImgLoader;
import com.supermali.entity.MapImageAbstract;

import java.awt.image.BufferedImage;
import java.util.List;

/**
 * @project runner
 * @Date 2021/3/6
 * @Auth yangrui
 **/
public class MushroomMonistor extends HurtAbstract {

    public MushroomMonistor(Double x, Double y, MapCreater mapCreater) {
        super(x, y, mapCreater);
        getMonitorMove().setXdirect(-1);
    }


    @Override
    public void init() {
        ImgHelper imgHelper = ImgLoader.getImgHelper(ImgKey.Monistor.MUSHROOM_MONISTOR);
        BufferedImage select = imgHelper.select(0);
        this.setBufferedImage(select);
    }

    @Override
    public void destroy(long delta) {
        MapCreater mapCreater = getMapCreater();
        List<MapImageAbstract> removes = mapCreater.getRemoves();
        removes.add(this);
    }
}
